﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using System.Reflection;
using DG.Tweening.Plugins.Options;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Core;

public class ActionBase : MonoBehaviour
{
	public static ActionBase ActionInstantiate;

	private void Awake()
	{
		ActionInstantiate = this;
	}
	public virtual void Start()
	{
		new WaitForSeconds(0.5f);
	}


	public void ActionFlyIn(GameObject go, Vector2 ennPosition)
	{
		go.transform.DOLocalMove(ennPosition, 1).From();
	}

	public void ExecAction(string menthName, object[] objs)
	{


		MethodInfo GetMethodFromFunction = ActionInstantiate.GetType().GetMethod(menthName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
		if (GetMethodFromFunction != null)
		{
			GetMethodFromFunction.Invoke(this, objs);
		}
	}
}


